package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.InstructionBytecodeEvent;

public class InstructionBytecodeEventImpl extends BytecodeEventImpl implements InstructionBytecodeEvent
{
    private int opcode;

    public InstructionBytecodeEventImpl(final int aOpcode) {
        opcode = aOpcode;
    }

    @Override
    public int getType() {
        return INSTRUCTION;
    }

    @Override
    public void setOpcode(final int aOpcode) {
        opcode = aOpcode;
    }

    @Override
    public int getOpcode() {
        return opcode;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeMethodVisitor().visitInstruction(this);
        return aBytecodeVisitor;
    }
}
